home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
pool.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
1KB
|
44 lines
-- pool state machine
beginStateMachine()
onMsg("buildMenu", function(msg)
if (repairMenu()) then return end
-- build the pie menu
clearPieMenu();
local character = getStateObjectFromID(msg.sender);
local button;
local stateMachineName = character.walkSO.getStateMachine().getName();
--print("buildMenu stateMachineName: " .. stateMachineName);
button = addPieMenuButton("pm_enterPool", "enterPool");
button.addDescription(ACTIVITY, "swim");
end )
-- swim
onMsg("enterPool", function(msg)
local character = getStateObjectFromID(msg.sender);
local entryPoints = this.getEntryPoints(character);
for p = 1, getn(entryPoints) do
print(" entryPoint " .. p);
local actionPoint = entryPoints[p];
-- get the walk state object
local wso = character.walkSO;
if (wso.walkToActionPoint(actionPoint)) then
wso.queueStateMachine("poolChar.sitDown", this);
return
end
end
print("no path found");
instantAbort(character, EMOTICON_NOPATH, "emoThink")
end )
endStateMachine()